package com.lesson9.decorator;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/8/31 9:24
 */
public class CoffeeBar
{
    public static void main(String[] args)
    {
        Drink drink = new YDLCoffee();
        System.out.println("费用="+drink.cost());
        //加一个牛奶
        drink = new Milk(drink);
        System.out.println("加入一份牛奶后的费用="+drink.cost());
        System.out.println("加入一份牛奶后的描述="+drink.getDesc());

        //又加入一份巧克力
        drink = new Chocolate(drink);
        System.out.println("又加入一份巧克力后的费用="+drink.cost());
        System.out.println("又加入一份巧克力后的描述="+drink.getDesc());
    }
}
